package ca.tatham.triplipse.views.table;

import java.util.Collection;

import ca.tatham.triplipse.Activator;
import ca.tatham.triplipse.RdfStatement;
import ca.tatham.triplipse.views.RdfDocumentContentProvider;

/**
 * Provides RdfStatement objects as is to a Table View of the RdfDocument
 * 
 * @author BenTatham
 */
class TableRdfDocumentContentProvider extends RdfDocumentContentProvider {

	/**
	 * 
	 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
	 */
	public Object[] getElements(@SuppressWarnings("unused")
	Object parent) {
		Collection<RdfStatement> statements = Activator.getDefault().getRdfDocument()
				.getTriples(getFilter());
		return statements.toArray();
	}

	@Override
	protected void filterChanged() {
		refresh();
	}

}
